﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace StudentManagement.Models
{
    
    public class MockStudentRepository : IStudentRepository
    {
        private List<Student> _studentList;
        public MockStudentRepository()
        {
            _studentList = new List<Student>()
            {
                new Student(){ Id = 1, Name = "meng1", ClassName = "大二啦", Email = "guohaomeng8@outlook.com" } ,
                new Student(){ Id = 2, Name = "meng2", ClassName = "大二啦x2", Email = "guohaomeng8@outlook.com" } ,
                new Student(){ Id = 3, Name = "meng3", ClassName = "大二啦x3", Email = "guohaomeng8@outlook.com" } ,
            };
        }
        public Student GetStudent(int id)
        {
            return _studentList.FirstOrDefault(a => a.Id == id);
        }
        public IEnumerable<Student> GetAllStudent()
        {
            return _studentList;
        }
    }
}
